package com.kashow.bean.user;

import android.text.TextUtils;

import com.kashow.bean.BaseBean;

/**
 * Created by yybs on 16/11/7.
 */

public class User extends BaseBean {

    /**
     * _id : 3
     * userName : 61
     * phone : 18600000000
     * openid : 61
     * wxUserInfo : {"openid":"61","nickname":"61","sex":2,"city":"杭州","province":"浙江","country":"中国","headimgurl":"http://wx.qlogo.cn/mmopen/PxpCwCeBADPsn6PvP65icDkY7XLv8B5Bk5BcHggwPdZtavVBM1KcBSAKnHOaHFyeeSTWGl47j3RiaYjXVX2QzDq8lhQVKyFqMn/0"}
     * __v : 0
     * createdAt : 2016-10-24T02:49:18.917Z
     * isSub : false
     * sex : 0
     * balance : 0
     * score : 0
     * level : 1
     * isTeacher : true
     * follows : 1
     * followers : 0
     * grade : -1
     * stars : 0
     */

    private int _id;
    private String userName;
    private String phone;
    private String openid;
    private String birthday;
    private String headimgurl;
    private String nickname;

    public String getNickname() {
        if (TextUtils.isEmpty(nickname) && wxUserInfo!= null) {
            nickname = wxUserInfo.getNickname();
        }
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getHeadimgurl() {
        if (TextUtils.isEmpty(headimgurl) && wxUserInfo != null) {
            headimgurl = wxUserInfo.getHeadimgurl();
        }
        return headimgurl;
    }

    public void setHeadimgurl(String headimgurl) {
        this.headimgurl = headimgurl;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    /**
     * openid : 61
     * nickname : 61
     * sex : 2
     * city : 杭州
     * province : 浙江
     * country : 中国
     * headimgurl : http://wx.qlogo.cn/mmopen/PxpCwCeBADPsn6PvP65icDkY7XLv8B5Bk5BcHggwPdZtavVBM1KcBSAKnHOaHFyeeSTWGl47j3RiaYjXVX2QzDq8lhQVKyFqMn/0
     */

    private WxUserInfoBean wxUserInfo;
    private String createdAt;
    private boolean isSub;
    private int sex;
    private int balance;
    private double score;
    private int level;
    private boolean isTeacher;
    private int follows;
    private int followers;
    private double grade;
    private int stars;
    private AuthInfoBean authInfo;

    public int get_id() {
        return _id;
    }

    public void set_id(int _id) {
        this._id = _id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public WxUserInfoBean getWxUserInfo() {
        return wxUserInfo;
    }



    public void setWxUserInfo(WxUserInfoBean wxUserInfo) {
        this.wxUserInfo = wxUserInfo;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public boolean isIsSub() {
        return isSub;
    }

    public void setIsSub(boolean isSub) {
        this.isSub = isSub;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public int getBalance() {
        return balance;
    }

    public void setBalance(int balance) {
        this.balance = balance;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public boolean isIsTeacher() {
        return isTeacher;
    }

    public void setIsTeacher(boolean isTeacher) {
        this.isTeacher = isTeacher;
    }

    public int getFollows() {
        return follows;
    }

    public void setFollows(int follows) {
        this.follows = follows;
    }

    public int getFollowers() {
        return followers;
    }

    public void setFollowers(int followers) {
        this.followers = followers;
    }

    public double getGrade() {
        return grade;
    }

    public void setGrade(double grade) {
        this.grade = grade;
    }

    public int getStars() {
        return stars;
    }

    public void setStars(int stars) {
        this.stars = stars;
    }

    public AuthInfoBean getAuthInfoBean() {
        return authInfo;
    }

    public void setAuthInfoBean(AuthInfoBean authInfoBean) {
        this.authInfo = authInfoBean;
    }

    public static class WxUserInfoBean {
        private String openid;
        private String nickname;
        private int sex;
        private String city;
        private String province;
        private String country;
        private String headimgurl;

        public String getOpenid() {
            return openid;
        }

        public void setOpenid(String openid) {
            this.openid = openid;
        }

        public String getNickname() {
            return nickname;
        }

        public void setNickname(String nickname) {
            this.nickname = nickname;
        }

        public int getSex() {
            return sex;
        }

        public void setSex(int sex) {
            this.sex = sex;
        }

        public String getCity() {
            return city;
        }

        public void setCity(String city) {
            this.city = city;
        }

        public String getProvince() {
            return province;
        }

        public void setProvince(String province) {
            this.province = province;
        }

        public String getCountry() {
            return country;
        }

        public void setCountry(String country) {
            this.country = country;
        }

        public String getHeadimgurl() {
            return headimgurl;
        }

        public void setHeadimgurl(String headimgurl) {
            this.headimgurl = headimgurl;
        }

        @Override
        public String toString() {
            return "WxUserInfoBean{" +
                    "openid='" + openid + '\'' +
                    ", nickname='" + nickname + '\'' +
                    ", sex=" + sex +
                    ", city='" + city + '\'' +
                    ", province='" + province + '\'' +
                    ", country='" + country + '\'' +
                    ", headimgurl='" + headimgurl + '\'' +
                    '}';
        }
    }


    public static class AuthInfoBean {

        /**
         * realName : 李文跃
         * cardNumber : 371528199008289393
         * cardPic1 : http://oss.kashowvr.com/wx/upload/media/kaAZKKGtlg0tLzq3BTF-VwEqHZKw5n5JVk4I8kI3TzfG3wmz_0NC7oFZKR_RfN8y.jpeg
         * cardPic2 : http://oss.kashowvr.com/wx/upload/media/U5tk6a2mdoYB5CKr5jnepfFeoztoeGZfG5HXT5xB8FD8hFJSOoKagzFZ9nQthHVF.jpeg
         * status : 1
         * updatedAt : 2016-11-18T08:31:30.084+0000
         * createdAt : 2016-11-18T08:31:30.085+0000
         */

        private String realName;
        private String cardNumber;
        private String cardPic1;
        private String cardPic2;
        private int status;
        private String updatedAt;
        private String createdAt;

        public String getRealName() {
            return realName;
        }

        public void setRealName(String realName) {
            this.realName = realName;
        }

        public String getCardNumber() {
            return cardNumber;
        }

        public void setCardNumber(String cardNumber) {
            this.cardNumber = cardNumber;
        }

        public String getCardPic1() {
            return cardPic1;
        }

        public void setCardPic1(String cardPic1) {
            this.cardPic1 = cardPic1;
        }

        public String getCardPic2() {
            return cardPic2;
        }

        public void setCardPic2(String cardPic2) {
            this.cardPic2 = cardPic2;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public String getUpdatedAt() {
            return updatedAt;
        }

        public void setUpdatedAt(String updatedAt) {
            this.updatedAt = updatedAt;
        }

        public String getCreatedAt() {
            return createdAt;
        }

        public void setCreatedAt(String createdAt) {
            this.createdAt = createdAt;
        }

        @Override
        public String toString() {
            return "AuthInfoBean{" +
                    "realName='" + realName + '\'' +
                    ", cardNumber='" + cardNumber + '\'' +
                    ", cardPic1='" + cardPic1 + '\'' +
                    ", cardPic2='" + cardPic2 + '\'' +
                    ", status=" + status +
                    ", updatedAt='" + updatedAt + '\'' +
                    ", createdAt='" + createdAt + '\'' +
                    '}';
        }
    }


    @Override
    public String toString() {
        return "User{" +
                "_id=" + _id +
                ", userName='" + userName + '\'' +
                ", phone='" + phone + '\'' +
                ", openid='" + openid + '\'' +
                ", wxUserInfo=" + wxUserInfo +
                ", createdAt='" + createdAt + '\'' +
                ", isSub=" + isSub +
                ", sex=" + sex +
                ", balance=" + balance +
                ", score=" + score +
                ", level=" + level +
                ", isTeacher=" + isTeacher +
                ", follows=" + follows +
                ", followers=" + followers +
                ", grade=" + grade +
                ", stars=" + stars +
                '}';
    }
}
